home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.FilterInputStream;
- import java.io.IOException;
- import java.util.Vector;
- import symjava.sql.SQLException;
-
- public class Param extends Field {
- // $FF: renamed from: _v java.util.Vector
- Vector field_0;
-
- private NetData getFirstDataBlock() throws SQLException {
- try {
- return (NetData)this.field_0.elementAt(0);
- } catch (Exception var1) {
- throw new SQLException("Data field not initialized");
- }
- }
-
- public Param(int id, byte[] data) {
- super._id = id;
- super._type = 108;
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data));
- }
-
- public Param(int id, byte[] data, int len) {
- super._id = id;
- super._type = 108;
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data, len));
- }
-
- public Param(int id, short data) {
- super._id = id;
- super._type = 100;
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data));
- }
-
- public Param(int id, boolean data) {
- super._id = id;
- super._type = 104;
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data));
- }
-
- public Param(int id, int data) {
- super._id = id;
- super._type = 101;
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data));
- }
-
- public Param(int id, int data, boolean objRef) {
- super._id = id;
- if (objRef) {
- super._type = 107;
- } else {
- super._type = 101;
- }
-
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data));
- }
-
- public Param(int id, long data) {
- super._id = id;
- super._type = 103;
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data));
- }
-
- public Param(int id, float data) {
- super._id = id;
- super._type = 105;
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data));
- }
-
- public Param(int id, double data) {
- super._id = id;
- super._type = 106;
- this.field_0 = new Vector();
- this.field_0.addElement(new NetData(data));
- }
-
- public Param() {
- super._id = 0;
- super._type = 0;
- this.field_0 = new Vector();
- }
-
- int getType() {
- return 57;
- }
-
- void read(DataInputStream in) throws SQLException, IOException, ErrorException {
- in.readShort();
- byte[] leader = new byte[4];
- in.readFully(leader, 0, 4);
- super._id = ((FilterInputStream)in).read();
- super._type = ((FilterInputStream)in).read();
- this.field_0 = new Vector();
-
- while(true) {
- ServerObject obj = (ServerObject)NetClass.getNextObject(in);
- if (obj.getType() == 51) {
- this.field_0.addElement(obj);
- } else {
- if (obj.getType() == 50) {
- return;
- }
-
- ((ServerObject)this).onObjectError(obj);
- }
- }
- }
-
- void write(DataOutputStream out) throws IOException {
- out.writeByte(this.getType());
- out.writeShort(6);
- out.writeBytes("FLD}");
- out.writeByte(super._id);
- out.writeByte(super._type);
-
- for(int i = 0; i < this.field_0.size(); ++i) {
- NetData d = (NetData)this.field_0.elementAt(i);
- d.write(out);
- }
-
- EOT eot = new EOT();
- eot.write(out);
- }
- }
-